UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+f+3AgM7snDDJUPcJULYu9s35ZbnTH9jxDucvK9VfNI=' 
WHERE 
  key_id = '51a0de414e9aa03147c2a6d2dea6c5d51f89db1e60ee21b03d8bb983b79c0589' 
  AND (
    token = '+f+3AgM7snDDJUPcJULYu9s35ZbnTH9jxDucvK9VfNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036