UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aF8oPOUsTmXbvaGR2p70By1sGRmjbyzyqAmJ8WlfJUY='
WHERE
key_id = 'a13a2126cb88b6fc32a49c1f3c80f01b5d44a013a44aba6af45f448edc44512e'
AND (
token = 'aF8oPOUsTmXbvaGR2p70By1sGRmjbyzyqAmJ8WlfJUY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)