UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ECrZ70+urjN268nh4thC7kYLeVzCiBl3wFC0gu/yDBA=' 
WHERE 
  key_id = '52a3beed14390afa7cfac3d691851b508dff3c9cf83f20d2ed3d0bd95642ff1b' 
  AND (
    token = 'ECrZ70+urjN268nh4thC7kYLeVzCiBl3wFC0gu/yDBA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027