UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LxIxGUCcSgD/xTWu8K0/beSLur3xuLOmuGBRUqi2DeI=' 
WHERE 
  key_id = 'e10da063222fc49e0a38ac7aa168553d5ee1da212d5dc31c834f118d37904b9d' 
  AND (
    token = 'LxIxGUCcSgD/xTWu8K0/beSLur3xuLOmuGBRUqi2DeI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019