UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oeARyN8vcQkU+f2lkiEY+mcDUfv8bGplBFUTAEZUjhc='
WHERE
key_id = 'f308253e2e9de2f4783f9a25a33f0147c501d3f9d8a4bac8bd388be50843f355'
AND (
token = 'oeARyN8vcQkU+f2lkiEY+mcDUfv8bGplBFUTAEZUjhc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)