UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2uaqz8e9mVTbd4Ynfaz6nMqhG3XHAMndc1ORdhy6tzY=' 
WHERE 
  key_id = 'c027e01139aa4d111f490f0431107507476c6275f33453326163d5ff334268ef' 
  AND (
    token = '2uaqz8e9mVTbd4Ynfaz6nMqhG3XHAMndc1ORdhy6tzY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025