UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M2rTGKHvsCYXU/mRg8XVBEYislMw2xl1e5lli/fQ1R0='
WHERE
key_id = '7d06c929853e3ce48097df83ec3fcad75b6d113688acac32046de5b4c39146ab'
AND (
token = 'M2rTGKHvsCYXU/mRg8XVBEYislMw2xl1e5lli/fQ1R0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)