UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/3VFruFHYYwJ8Rn/Od1FhOpPov3zIzwceQ+1qoH2gJk='
WHERE
key_id = '4e8a63a0b25df4b5bcdd83b3dd22cb32f93924c9cb260a963c01b6cc8fa206bd'
AND (
token = '/3VFruFHYYwJ8Rn/Od1FhOpPov3zIzwceQ+1qoH2gJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)