UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '039WiamD+DyUKgqoVZChEgWszX2caXJ62IwF3PD7LEU='
WHERE
key_id = '4e44f331ca56806de188cf9edca4659fa8f684de197aa7ec85c337379cae85cf'
AND (
token = '039WiamD+DyUKgqoVZChEgWszX2caXJ62IwF3PD7LEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)