UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gnhl0AxIGO95AVKkAUZg6sQbcEHdh2uRZJxH9DT9ors=' 
WHERE 
  key_id = '72850a25a7bd35e8492e06465d634a2ed895f82c3b8b1990c283677725955bf1' 
  AND (
    token = 'gnhl0AxIGO95AVKkAUZg6sQbcEHdh2uRZJxH9DT9ors=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033