UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4i2dArdcpiZtHXR3B3h+WYflxX+ECsJMoMwWbpDUzVo='
WHERE
key_id = '697d32abde20e22a945851a3aa306fa2ed6d2e208d002ee3e97e991877b09313'
AND (
token = '4i2dArdcpiZtHXR3B3h+WYflxX+ECsJMoMwWbpDUzVo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)