UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W2BvD8h09l5bCk80P1BKDINgPjQcWffofojwdj8BtmE=' 
WHERE 
  key_id = 'fc182ceec311c0021a42457c43f270cb54b02a62a821e3940343e7a29c24fdbd' 
  AND (
    token = 'W2BvD8h09l5bCk80P1BKDINgPjQcWffofojwdj8BtmE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029