UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tegt6v4ss7ZY6yBgCOAdrKXHO5xcLP2RlNynI0pJ92o='
WHERE
key_id = '112f887c67331eb4c2e6aab192e03f1c3a55b52c4e6a98175c6746a9c091aa95'
AND (
token = 'tegt6v4ss7ZY6yBgCOAdrKXHO5xcLP2RlNynI0pJ92o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)