UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j4vM1jX4v8tGHqb923ISlMwX9dMFATJai7ebhko/pRE='
WHERE
key_id = 'fa98d57368465977d0ab511322944b8a5c9b9e40183954de0915d29018e53fa4'
AND (
token = 'j4vM1jX4v8tGHqb923ISlMwX9dMFATJai7ebhko/pRE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)