UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nVo3xp/K7IjEFzucl0tBcDUAvY1BLedZV4AqQYElMrg='
WHERE
key_id = 'df96aa2969dd76152ab5f2ced9b8674310d7400a340f2a1ec0937376cb22132f'
AND (
token = 'nVo3xp/K7IjEFzucl0tBcDUAvY1BLedZV4AqQYElMrg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)