UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ygb4wtTWS14BfSJ8/KUehJcaq0MnUiDicTbZmr+ArEk='
WHERE
key_id = '05bc104c51326b856675c3556a96b6daae47e25f2bc39e20907c625c48411e05'
AND (
token = 'Ygb4wtTWS14BfSJ8/KUehJcaq0MnUiDicTbZmr+ArEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)