UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kh5A2jFddFZJrGtqfu1w2f6y3j/eE/aGMaFnfSoMyCM='
WHERE
key_id = 'f245f71c85923f28f33166e319072a2b1d5152bf7ede45b38cfbd1a4b9098ce3'
AND (
token = 'Kh5A2jFddFZJrGtqfu1w2f6y3j/eE/aGMaFnfSoMyCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)