UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pDycFyfL8LQ/OhdKSGNm9SvZvXkiQJjF77Xxz8MCzEc=' 
WHERE 
  key_id = '98d2f81c4167f5e2c8c355bca31f43a9a0c0adbb5180902ab44c01f9cb745654' 
  AND (
    token = 'pDycFyfL8LQ/OhdKSGNm9SvZvXkiQJjF77Xxz8MCzEc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033