UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ACmLuMMIiwsouApo5Nn+z6nJ2MFWlU9Yd48feca/eZY=' 
WHERE 
  key_id = '03e19b2d9d387fb88101e377494bb6495486cf76db1906ea81b911689a9ab1ca' 
  AND (
    token = 'ACmLuMMIiwsouApo5Nn+z6nJ2MFWlU9Yd48feca/eZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035