UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WXG1gZMuelDoOpxSS3DncUJcRr33xjNK/sdc+/5UxK0='
WHERE
key_id = '45f9e81b49425853183ed1ad939633d016a4c7a631cf9d846c8962df5717d98b'
AND (
token = 'WXG1gZMuelDoOpxSS3DncUJcRr33xjNK/sdc+/5UxK0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)