UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lbgILUrOn0PiqdGKBjYB9uKvYNMTIig42rOpYUZ3H9s='
WHERE
key_id = '105b7fe99a0e4c5d259f0d6ed8fedd134bfb19aab28e06b230ecd2f8d255786c'
AND (
token = 'lbgILUrOn0PiqdGKBjYB9uKvYNMTIig42rOpYUZ3H9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)