UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vSBFPkijXFthitEzg5rKYr2BMpPGgNI3SNfKQSz6uJA='
WHERE
key_id = '3feded698751c84898bb6ac2dc7d60d526c1e24bf60c8e90b15898b57d320858'
AND (
token = 'vSBFPkijXFthitEzg5rKYr2BMpPGgNI3SNfKQSz6uJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)