UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TJHXcfXv5lWmVhx4w7RHdoSAuMoIQl8kujPoaKnC/KI='
WHERE
key_id = '628f80332a25a2558887851d618b163785737e737d48cecb68d451aacdeddc20'
AND (
token = 'TJHXcfXv5lWmVhx4w7RHdoSAuMoIQl8kujPoaKnC/KI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)