UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OJR/JtPaxlUIHrKdsiVT2C1tA/7uaTJ0NUYrmJjwIvQ='
WHERE
key_id = 'effdcddc5d3c721f0eb047d0766b7d51bc6d958ea9c3bcb386c99c143315e52a'
AND (
token = 'OJR/JtPaxlUIHrKdsiVT2C1tA/7uaTJ0NUYrmJjwIvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)