UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6kTVoj/OkM0k1NykBiZcgue0ygFy4syB9vVJwtxzS/o=' 
WHERE 
  key_id = '7c0384902cdbf6b4ee2ee58911af699b82f1dcbee877be5e5f1bed34438cd4c5' 
  AND (
    token = '6kTVoj/OkM0k1NykBiZcgue0ygFy4syB9vVJwtxzS/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033