UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '14+6AD7JsuLiD40MaOXELRvbNR6vVH4Zdxo6Ovg2fXE=' 
WHERE 
  key_id = '04739f406b48fae18ad4fae5cac34708f88f20883f920569b5a894dcdb82148a' 
  AND (
    token = '14+6AD7JsuLiD40MaOXELRvbNR6vVH4Zdxo6Ovg2fXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030