UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6S1h55ikNbeDd0kiZF8ICVKSN/iPL8BnDTvFpXdHCZI='
WHERE
key_id = '2d6f1f0a7cb83d06d47c9320aa552a1430b4a2fe714f88cab026d45a46243c7f'
AND (
token = '6S1h55ikNbeDd0kiZF8ICVKSN/iPL8BnDTvFpXdHCZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)