UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4M4T948228wZizBTE03NgvHsFSdZe3UwRbO/01ovp4Q='
WHERE
key_id = 'def30351d16ebd64569201212003ae98e94746f51c681e41d8055bf116fdf202'
AND (
token = '4M4T948228wZizBTE03NgvHsFSdZe3UwRbO/01ovp4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)