UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WmGRWJzLDJPXmkK/Pv8MODXTMgCnch5xlCjivO57CYE='
WHERE
key_id = '33d1fb1fade181a6ccee67bef51059261132d89e9dc7fa68fa001b015bc782d6'
AND (
token = 'WmGRWJzLDJPXmkK/Pv8MODXTMgCnch5xlCjivO57CYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)