UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TQNAWKmPgjb9VfpNh/Pg+uYVv9fTPcQ80kzLv3F+8Ek='
WHERE
key_id = 'cf7056e824283b9c6a5785427980837122b1372fd9089ca949cc1a99f1928246'
AND (
token = 'TQNAWKmPgjb9VfpNh/Pg+uYVv9fTPcQ80kzLv3F+8Ek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)