UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DWLllxW20qQgP2eMBGIwuZEz5YluI/hJDY0WJxbV8rg='
WHERE
key_id = 'd24c30d60c3d9d05a6a6298e52dc3dcb2789777807a619c47ffe98a19e98245b'
AND (
token = 'DWLllxW20qQgP2eMBGIwuZEz5YluI/hJDY0WJxbV8rg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)