UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qPP/nl3HunvF+olgjQfH/53KT0xw/Y0rC21m9Y7Bv30='
WHERE
key_id = 'cafed38d5d6fee1e07773154096f5eb1d5b2de9edb42aff7b72b97ac1a0fd95a'
AND (
token = 'qPP/nl3HunvF+olgjQfH/53KT0xw/Y0rC21m9Y7Bv30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)