UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qfxbe4N6n6B2gicOX7Xo5L+3HhrW4L3a+oTVzYf5ZBc='
WHERE
key_id = 'bc2282d953a90a987a55d7ca314e8d3d9c2a160164afdc3a4d7dc4ce564dc1b0'
AND (
token = 'Qfxbe4N6n6B2gicOX7Xo5L+3HhrW4L3a+oTVzYf5ZBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)