UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fbh7BcJGPEbMOsLBzWMm7mXa4LUwAGtACiySNQ5msdY='
WHERE
key_id = '61c6fb377d817f0a61e4e58463f9c0d2d1efbb9d2c062568a677340d6809c716'
AND (
token = 'Fbh7BcJGPEbMOsLBzWMm7mXa4LUwAGtACiySNQ5msdY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)