UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BCLpkrGtMMt8m+azs0d7gJHBuzn6PBN+v5Yk4c1HL5M=' 
WHERE 
  key_id = '93c9577dff1ad8d2b5087af30e43aa46bc767ddb5e208b4e26bf425061c7fd6a' 
  AND (
    token = 'BCLpkrGtMMt8m+azs0d7gJHBuzn6PBN+v5Yk4c1HL5M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024