UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6g/Aj9LNws54/ucT2aCAkgreusOmmlURrwmsftRrRYo='
WHERE
key_id = '2b00298f0b2dc5c2674d118ff62645f2b9f9dc0820e0a3757dbdb1364114671c'
AND (
token = '6g/Aj9LNws54/ucT2aCAkgreusOmmlURrwmsftRrRYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)